import { BwHtmlComNameEnum } from '../../../render/enums'

import type { BwDesignNodeComDefaultOptionModel } from '../../model'
import { htmlAOptions } from './src/a'

import { htmlDivOptions } from './src/div'
import { htmlIframeOptions } from './src/iframe'

/** 获取组件默认配置信息 */
export function getHtmlComDefaultConfig(comCode: BwHtmlComNameEnum) {
  const data: BwDesignNodeComDefaultOptionModel = {
    attrs: null,
    enableSlotList: null,
  }
  switch (comCode) {
    case BwHtmlComNameEnum.span: {
      data.attrs = null
      data.enableSlotList = null
      break
    }
    case BwHtmlComNameEnum.div: {
      data.attrs = htmlDivOptions.attrs
      data.enableSlotList = htmlDivOptions.slotList
      break
    }
    case BwHtmlComNameEnum.iframe: {
      data.attrs = htmlIframeOptions.attrs
      data.enableSlotList = htmlIframeOptions.slotList
      break
    }
    case BwHtmlComNameEnum.a: {
      data.attrs = htmlAOptions.attrs
      data.enableSlotList = htmlAOptions.slotList
      break
    }
  }
  return data
}
